ui/search.js \
ui/searchDisplay.js \
ui/shellDBus.js \
- ui/statusIconDispatcher.js \
ui/status/accessibility.js \
ui/status/keyboard.js \
ui/status/network.js \
const WindowManager = imports.ui.windowManager;
const Magnifier = imports.ui.magnifier;
const XdndHandler = imports.ui.xdndHandler;
-const StatusIconDispatcher = imports.ui.statusIconDispatcher;
const Util = imports.misc.util;
const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides';
let uiGroup = null;
let magnifier = null;
let xdndHandler = null;
-let statusIconDispatcher = null;
let keyboard = null;
let layoutManager = null;
let networkAgent = null;
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
overview = new Overview.Overview();
magnifier = new Magnifier.Magnifier();
- statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
screenShield = new ScreenShield.ScreenShield();
screenSaverDBus = new ShellDBus.ScreenSaverDBus();
panel = new Panel.Panel();
Lang.bind(overview, overview.toggle));
}
- statusIconDispatcher.start(messageTray.actor);
-
// Provide the bus object for gnome-session to
// initiate logouts.
EndSessionDialog.init();
]
};
+const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
+ 'bluetooth-applet': 'bluetooth',
+ 'gnome-volume-control-applet': 'volume', // renamed to gnome-sound-applet
+ // when moved to control center
+ 'gnome-sound-applet': 'volume',
+ 'nm-applet': 'network',
+ 'gnome-power-manager': 'battery',
+ 'keyboard': 'keyboard',
+ 'a11y-keyboard': 'a11y',
+ 'kbd-scrolllock': 'keyboard',
+ 'kbd-numlock': 'keyboard',
+ 'kbd-capslock': 'keyboard',
+ 'ibus-ui-gtk': 'keyboard'
+};
+
const NotificationDaemon = new Lang.Class({
Name: 'NotificationDaemon',
this._notifications = {};
this._busProxy = new Bus();
- Main.statusIconDispatcher.connect('message-icon-added', Lang.bind(this, this._onTrayIconAdded));
- Main.statusIconDispatcher.connect('message-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
+ this._trayManager = new Shell.TrayManager();
+ this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
+ this._trayManager.connect('tray-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
Shell.WindowTracker.get_default().connect('notify::focus-app',
Lang.bind(this, this._onFocusAppChanged));
Main.overview.connect('hidden',
Lang.bind(this, this._onFocusAppChanged));
+
+ this._trayManager.manage_stage(global.stage, Main.messageTray.actor);
},
_iconForNotificationData: function(icon, hints) {
},
_onTrayIconAdded: function(o, icon) {
+ let wmClass = icon.wm_class.toLowerCase();
+ if (STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass] !== undefined)
+ return;
+
let source = this._getSource(icon.title || icon.wm_class || C_("program", "Unknown"), icon.pid, null, null, icon);
},
this._centerBox.add(this._dateMenu.actor, { y_fill: true });
this._menus.addMenu(this._dateMenu.menu);
- /* right */
- Main.statusIconDispatcher.connect('status-icon-added', Lang.bind(this, this._onTrayIconAdded));
- Main.statusIconDispatcher.connect('status-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
-
Main.layoutManager.panelBox.add(this.actor);
Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here',
{ sortGroup: CtrlAltTab.SortGroup.TOP });
return indicator;
},
- _onTrayIconAdded: function(o, icon, role) {
- if (Main.sessionMode.statusArea.implementation[role]) {
- // This icon is legacy, and replaced by a Shell version
- // Hide it
- return;
- }
-
- if (Main.sessionMode.statusArea.order.indexOf(role) == -1)
- return;
-
- icon.height = PANEL_ICON_SIZE;
- let buttonBox = new PanelMenu.ButtonBox();
- let box = buttonBox.actor;
- box.add_actor(icon);
-
- this._insertStatusItem(box, Main.sessionMode.statusArea.order.indexOf(role));
- },
-
- _onTrayIconRemoved: function(o, icon) {
- let box = icon.get_parent();
- if (box && box._delegate instanceof PanelMenu.ButtonBox)
- box.destroy();
- },
-
_onLockStateChanged: function(shield, locked) {
if (this._activitiesButton)
this._activitiesButton.setLockedState(locked);
+++ /dev/null
-// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-
-const Lang = imports.lang;
-const Shell = imports.gi.Shell;
-const Signals = imports.signals;
-
-const MessageTray = imports.ui.messageTray;
-const NotificationDaemon = imports.ui.notificationDaemon;
-const Util = imports.misc.util;
-
-const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
- 'bluetooth-applet': 'bluetooth',
- 'gnome-volume-control-applet': 'volume', // renamed to gnome-sound-applet
- // when moved to control center
- 'gnome-sound-applet': 'volume',
- 'nm-applet': 'network',
- 'gnome-power-manager': 'battery',
- 'keyboard': 'keyboard',
- 'a11y-keyboard': 'a11y',
- 'kbd-scrolllock': 'keyboard',
- 'kbd-numlock': 'keyboard',
- 'kbd-capslock': 'keyboard',
- 'ibus-ui-gtk': 'keyboard'
-};
-
-const StatusIconDispatcher = new Lang.Class({
- Name: 'StatusIconDispatcher',
-
- _init: function() {
- this._traymanager = new Shell.TrayManager();
- this._traymanager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
- this._traymanager.connect('tray-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
-
- // Yet-another-Ubuntu-workaround - we have to kill their
- // app-indicators, so that applications fall back to normal
- // status icons
- // http://bugzilla.gnome.org/show_bug.cgi=id=621382
- Util.killall('indicator-application-service');
- },
-
- start: function(themeWidget) {
- this._traymanager.manage_stage(global.stage, themeWidget);
- },
-
- _onTrayIconAdded: function(o, icon) {
- let wmClass = (icon.wm_class || 'unknown').toLowerCase();
- let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
- if (role)
- this.emit('status-icon-added', icon, role);
- else
- this.emit('message-icon-added', icon);
- },
-
- _onTrayIconRemoved: function(o, icon) {
- let wmClass = (icon.wm_class || 'unknown').toLowerCase();
- let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
- if (role)
- this.emit('status-icon-removed', icon);
- else
- this.emit('message-icon-removed', icon);
- }
-});
-Signals.addSignalMethods(StatusIconDispatcher.prototype);